﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RaytracerLib.MathLib;
using TomanuExtensions;

namespace RaytracerLib.UVMappers
{
    public abstract class UVMapper
    {
        public abstract Vector2 Map(Vector3 a_uvw);
        public abstract UVMappingMethod Method { get; }

        public static UVMapper Create(UVMappingMethod a_mapping_method)
        {
            switch (a_mapping_method)
            {
                case UVMappingMethod.Cylindrical: return new CylindricalUVMapper();
                case UVMappingMethod.Conical: return new ConicalUVMapper();
                case UVMappingMethod.Spherical: return new SphericalUVMapper();
                case UVMappingMethod.Toroidal: return new TorodidalUVMapper();
                default: throw new NotImplementedException();
            }
        }
    }
}
